package sellcar;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Marcos
 */
public class Tela_Principal extends javax.swing.JFrame {

    /**
     * Creates new form Tela_Principal
     */
    public Tela_Principal() {
        initComponents();
       this.setLocationRelativeTo(null);
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        Tela_Cadastros = new javax.swing.JButton();
        Tela_Pedido = new javax.swing.JButton();
        Tela_Relatorio = new javax.swing.JButton();
        Sair_Sistema = new javax.swing.JButton();
        Tela_Cotacao = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Sistema Informatizado de Venda", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 0, 18))); // NOI18N
        jPanel1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jPanel1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        Tela_Cadastros.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/page_edit.png"))); // NOI18N
        Tela_Cadastros.setMnemonic('C');
        Tela_Cadastros.setText("Cadastros");
        Tela_Cadastros.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Tela_CadastrosActionPerformed(evt);
            }
        });

        Tela_Pedido.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/book.png"))); // NOI18N
        Tela_Pedido.setMnemonic('P');
        Tela_Pedido.setText("Pedido");
        Tela_Pedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Tela_PedidoActionPerformed(evt);
            }
        });

        Tela_Relatorio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/report.png"))); // NOI18N
        Tela_Relatorio.setMnemonic('R');
        Tela_Relatorio.setText("Relatório");
        Tela_Relatorio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Tela_RelatorioActionPerformed(evt);
            }
        });

        Sair_Sistema.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/door_out.png"))); // NOI18N
        Sair_Sistema.setMnemonic('S');
        Sair_Sistema.setText("Sair");
        Sair_Sistema.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Sair_SistemaActionPerformed(evt);
            }
        });

        Tela_Cotacao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/book.png"))); // NOI18N
        Tela_Cotacao.setMnemonic('C');
        Tela_Cotacao.setText("Cotação");
        Tela_Cotacao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Tela_CotacaoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(Tela_Cotacao, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Tela_Cadastros, javax.swing.GroupLayout.PREFERRED_SIZE, 370, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Tela_Pedido)
                    .addComponent(Tela_Relatorio)
                    .addComponent(Sair_Sistema))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {Sair_Sistema, Tela_Cadastros, Tela_Pedido, Tela_Relatorio});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Tela_Cadastros, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(Tela_Pedido)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(Tela_Cotacao, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(Tela_Relatorio)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(Sair_Sistema)
                .addGap(44, 44, 44))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {Sair_Sistema, Tela_Cadastros, Tela_Pedido, Tela_Relatorio});

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(52, 52, 52)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(66, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(56, 56, 56)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 282, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(64, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void Tela_CadastrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Tela_CadastrosActionPerformed
        new Tela_Cadastros().setVisible(true);
        // TODO add your handling code here:
    }//GEN-LAST:event_Tela_CadastrosActionPerformed

    private void Tela_RelatorioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Tela_RelatorioActionPerformed
        new Tela_Relatorio().setVisible(true);
       
            }//GEN-LAST:event_Tela_RelatorioActionPerformed

    private void Sair_SistemaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Sair_SistemaActionPerformed
        // TODO add your handling code here:
        int resp = JOptionPane.showConfirmDialog(null,"Deseja realmente sair ?");
        if(resp == JOptionPane.YES_OPTION)
        {
            System.exit(0);
        }
    }//GEN-LAST:event_Sair_SistemaActionPerformed

    private void Tela_PedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Tela_PedidoActionPerformed

        
        if(evt.getSource() == Tela_Pedido)
        {
            Pedidos_Veiculo pc = new Pedidos_Veiculo();
            pc.setVisible(true);
            
        }// TODO add your handling code here:
    }//GEN-LAST:event_Tela_PedidoActionPerformed

    private void Tela_CotacaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Tela_CotacaoActionPerformed
        // TODO add your handling code here:
        new Pedidos_Cotação().setVisible(true);
    }//GEN-LAST:event_Tela_CotacaoActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Tela_Principal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Sair_Sistema;
    private javax.swing.JButton Tela_Cadastros;
    private javax.swing.JButton Tela_Cotacao;
    private javax.swing.JButton Tela_Pedido;
    private javax.swing.JButton Tela_Relatorio;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
}
